package cglgu.trellis.chado.das2.modelimpl;

/*
 * $Id: ChadoSource.java 191 2011-03-27 00:38:22Z sundaram.georgetown@gmail.com $
 * $Author: sundaram.georgetown@gmail.com $
 * $Date: 2011-03-27 00:38:22 +0000 (Sun, 27 Mar 2011) $
 * $Rev: 191 $
 * $HeadURL: http://genomancer.googlecode.com/svn/branches/gu-dev-branch/tengcha/src/cglgu/trellis/chado/das2/modelimpl/ChadoSource.java $
 */

import genomancer.trellis.das2.model.Das2SourceI;
import genomancer.vine.das2.client.modelimpl.Das2Source;
import java.net.URI;
import java.sql.ResultSet;
import java.sql.SQLException;


public class ChadoSource extends Das2Source implements Das2SourceI  {

	String name; 
	String id;  // relative URI based on name
	String clade;
	int priority;
	ChadoSourcesCapability chado_sources_cap;

	/**
	 *  Assumes ResultSet contains all columns in hgcentral genomeClade table ("genome", "clade", "priority");
	 *    (can have others, for example from a join)
	 */
	public ChadoSource(URI base_uri, String genome, ChadoSourcesCapability csc)  throws SQLException {  

		super(
				base_uri,
				genome.replace(' ', '_'), // local_uri_string
				genome,   // title
				null,   // description
				null    // info_url
		);

		name = genome;
		id = name.replace(' ', '_');
		clade = null
		priority = 1;
		this.chado_sources_cap = csc;
	}

	public String getID()  { return id; }
	public String getName()  { return name; }
	public String getClade()  { return clade; }
	public int getPriority()  { return priority; }
	public ChadoSourcesCapability getSourcesCapability()  { return chado_sources_cap; }

}
